﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication1.Views
{
	/// <summary>
	/// Interaction logic for FriendRequestView.xaml
	/// </summary>
	public partial class FriendRequestView : UserControl
	{
        public FormConfirm form = null;
        static FriendRequestView choosen = null;

		public FriendRequestView()
		{
			this.InitializeComponent();
		}

        public void HideCloseButton()
        {
            close_button.Visibility = Visibility.Hidden;
        }
        public void ShowCloseButton()
        {
            close_button.Visibility = Visibility.Visible;
        }

        private void confirm_button_Click(object sender, RoutedEventArgs e)
        {
            if ((choosen != this) && (choosen != null))
            {
                choosen.form.Close();
                choosen.HideCloseButton();
            }
            choosen = this;
            ShowCloseButton();
            if (form != null)
            {
                form.Close();
            }

            form = new FormConfirm(hidden_id.Text);
            form.Show();
        }

        private void close_button_Click(object sender, RoutedEventArgs e)
        {
            HideCloseButton();
            if (form != null)
            {
                form.Close();
            }
        }
	}
}